<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/5/10
  Time: 9:27
  To change this template use File | Settings | File Templates.
--%>
<%--<%@ page import="java.util.Date" %>--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>我的考试</title>
  <script type="text/javascript" src="${path}/js/resource/jquery.min.js"></script>
  <script type="text/javascript" src="${path}/js/resource/bootstrap.min.js"></script>
  <script type="text/javascript" src="${path}/js/resource/icheck.js"></script>
  <link rel="stylesheet" href="${path}/css/resource/bootstrap.min.css">
  <link rel="stylesheet" href="${path}/css/resource/blue.css">
  <script type="text/javascript">
    $(document).ready(function(){
      $('input').iCheck({
        checkboxClass: 'icheckbox_square-blue',
        radioClass: 'iradio_square-blue',
        increaseArea: '20%'
      });
    });

  </script>
  <style type="text/css">
    .b {
      font-weight:bold;
    }
    .infot {
      margin-left: 75px;
    }
    .iradio_square-blue {
      width: 24px;
      height: 24px;
      background: url(${path}/static/images/blue.png) no-repeat;
      background-position: -120px 0;
    }
    .icheckbox_square-blue {
      width: 24px;
      height: 24px;
      background: url(${path}/static/images/blue.png) no-repeat;
    }
    .choicea{
      font-size: 17px;
    }
    .choice{
      margin-left: 15px;
      margin-top: 10px;
      font-size: 17px;
    }
    .tborder{
      border:1px  dotted #66B3FF;
      margin-right: 300px;
      margin-left: 80px;
    }
  </style>
</head>

<body>
<ul class="nav nav-tabs">
  <li><a href="${ctx}/teach/teachStudentPaper/stuExamList/">考试列表</a></li>
  <li class="active">
     <a>
      答题情况
    </a>
    <%--</a>--%>
  </li>
</ul><br/>
<form:form id="inputForm" modelAttribute="resourcePaper" action="${ctx}stu/stuLearn/" method="post" class="form-horizontal">
<input type="hidden" name="examId" id="examId" value="${examId}">

<div class="container-fluid">
  <div class="row">
    <div class="col-md-10">
      <div class="row">
          <div class="col-md-5 col-md-offset-2">
          <h3 class="b">试卷名称：${resourcePaper.paperName}</h3>
        </div>
        <div class="col-md-4 ">
          <h3 class="infot b">总分：${stuTotalScoreS}</h3>

        </div>
      </div>

      <!-- 单选题 -->
      <div class="row">
        <div class="col-md-2  col-md-offset-1" >
          <h4 class="b">一、单选题</h4>
        </div>
        <div class="col-md-2  col-md-offset-1">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:if test="${resourceQuestion.questionType == '0' }">
              <c:set var="index" value="${index+1}" />
            </c:if>
          </c:forEach>
          <h4 class="b">题目数量：${index}</h4>
        </div>
        <div class="col-md-2  col-md-offset-1">
          <h4 class="b">每题分值：
            <c:if test="${resourcePaper.paperType == '1'}">
              <c:if test="${resourceQuestionListRadio!=null&&fn:length(resourceQuestionListRadio)!=0}">
                ${resourceQuestionListRadio[0].questionScore}
              </c:if>
            </c:if>
            <c:if test="${resourcePaper.paperType == '2'}">
              <c:if test="${resourcePaper.radioScore!=null}">
                ${resourcePaper.radioScore}
              </c:if>
            </c:if>
          </h4>
        </div>
      </div>

      <div class="col-md-offset-1" style="padding-left: 15px;">
        <c:set var="index" value="0" />
        <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
        <%--<c:forEach var="resourceQuestion" items="${resourceQuestionListRadio}">--%>
          <c:set var="indexAns" value="${resourceQuestion.id}" />
          <div class="row choicea">
            <c:if test="${resourceQuestion.questionType == '0' }">
              <c:set var="index" value="${index+1}" />
              ${index}、${resourceQuestion.stem}
              <div class="row" >
                <br>

                <c:forEach var="teachStudentPaper" items="${teachStudentPaper}">

                  <c:if test="${teachStudentPaper.questionId == indexAns }">
                    <c:set var="answer" value="${teachStudentPaper.answer}" />
                    <c:set var="quesId" value="${teachStudentPaper.id}" />
                    <div class="choice" >
                      <c:set var="value" value="a" />
                      <c:set var="status" value="${teachStudentPaper.answer.equals(value) }" />
                      <input type="radio" name="${quesId}"    <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                      A、${resourceQuestion.option.optionA}
                    </div>
                    <div class="choice">
                      <c:set var="value" value="b" />
                      <input type="radio" name="${quesId}"    <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                      B、${resourceQuestion.option.optionB}
                    </div>
                    <div class="choice">
                      <c:set var="value" value="c" />
                      <input type="radio" name="${quesId}"   <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                      C、${resourceQuestion.option.optionC}
                    </div>
                    <div class="choice">
                      <c:set var="value" value="d" />
                      <input type="radio" name="${quesId}"    <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                      D、${resourceQuestion.option.optionD}
                    </div>

                <c:if test="${ifCheckAnswer eq 1 }">
                <div class="choice">
                  <p style="color: red">正确答案是：
                    <c:forEach var="resourceQuestionAnswer" items="${resourceQuestionAnswer}">
                        <c:if test="${resourceQuestionAnswer.questionId == indexAns }">
                            ${resourceQuestionAnswer.answer}
                        </c:if>
                    </c:forEach>
                </div>
                </c:if>

                  </c:if>
                </c:forEach>
              </div>
              <br>
              <br>
            </c:if>
          </div>

        </c:forEach>
      </div>



      <div class="row">
        <div class="col-md-2  col-md-offset-1">
          <h4 class="b">二、多选题</h4>
        </div>
        <div class="col-md-2 col-md-offset-1">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:if test="${resourceQuestion.questionType == '1' }">
              <c:set var="index" value="${index+1}" />
            </c:if>
          </c:forEach>
          <h4 class="b">题目数量：${index}</h4>
        </div>
        <div class="col-md-2 col-md-offset-1">
          <h4 class="b">每题分值：
            <c:if test="${resourcePaper.paperType == '1'}">
              <c:if test="${resourceQuestionListCheckbox!=null&&fn:length(resourceQuestionListCheckbox)!=0}">${resourceQuestionListCheckbox[0].questionScore}</c:if>
            </c:if>

            <c:if test="${resourcePaper.paperType == '2'}">
            <c:if test="${resourcePaper.checkboxScore !=null}">${resourcePaper.checkboxScore}</c:if></h4>
          </c:if>
          </h4>
        </div>
      </div>

        <div class="col-md-offset-1" style="padding-left: 30px;">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:set var="indexAns1" value="${resourceQuestion.id}" />
            <div class="row  choicea">
              <c:if test="${resourceQuestion.questionType == '1' }">
                <c:set var="index" value="${index+1}" />
                ${index}、${resourceQuestion.stem}
                <div class="row ">
                  <br>
                  <c:forEach var="teachStudentPaper" items="${teachStudentPaper}">
                    <c:if test="${teachStudentPaper.questionId == indexAns1 }">
                      <c:set var="answer" value="${teachStudentPaper.answer}" />
                      <c:set var="quesId" value="${teachStudentPaper.id}" />
                      <div class="choice">
                        <c:set var="value" value="a" />
                        <c:set var="status" value="${teachStudentPaper.answer.equals(value) }" />
                        <input type="checkbox" name="${quesId}"    <c:if test="${answer.indexOf(value)>=0}"> checked="checked"</c:if>  >
                        A、${resourceQuestion.option.optionA}
                      </div>
                      <div class="choice" >
                        <c:set var="value" value="b" />
                        <input type="checkbox" name="${quesId}"    <c:if test="${answer.indexOf(value)>=0}"> checked="checked"</c:if>  >
                        B、${resourceQuestion.option.optionB}
                      </div>
                      <div class="choice">
                        <c:set var="value" value="c" />
                        <input type="checkbox" name="${quesId}"   <c:if test="${answer.indexOf(value)>=0}"> checked="checked"</c:if>  >
                        C、${resourceQuestion.option.optionC}
                      </div>
                      <div class="choice" >
                        <c:set var="value" value="d" />
                        <input type="checkbox" name="${quesId}"    <c:if test="${answer.indexOf(value)>=0}"> checked="checked"</c:if>  >
                        D、${resourceQuestion.option.optionD}
                      </div>

                  <c:if test="${ifCheckAnswer eq 1 }">
                  <div class="choice" >
                    <p style="color: red">正确答案是：
                      <c:forEach var="resourceQuestionAnswer" items="${resourceQuestionAnswer}">
                        <c:if test="${resourceQuestionAnswer.questionId == indexAns1 }">
                              ${resourceQuestionAnswer.answer}
                        </c:if>
                      </c:forEach>
                    </div>
                  </c:if>

                    </c:if>
                  </c:forEach>
                </div>
                <br>
                <br>
              </c:if>
            </div>
          </c:forEach>
        </div>
      <%--</div>--%>

      <div class="row">
        <div class="col-md-2 col-md-offset-1">
          <h4 class="b">三、判断题</h4>
        </div>

        <div class="col-md-2 col-md-offset-1">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:if test="${resourceQuestion.questionType == '2' }">
              <c:set var="index" value="${index+1}" />
            </c:if>
          </c:forEach>
          <h4 class="b">题目数量：${index}</h4>
        </div>

        <div class="col-md-2 col-md-offset-1">
          <h4 class="b">每题分值：
            <c:if test="${resourcePaper.paperType == '1'}">
              <c:if test="${resourceQuestionListJudement!=null&&fn:length(resourceQuestionListJudement)!=0}">${resourceQuestionListJudement[0].questionScore}</c:if>
            </c:if>
            <c:if test="${resourcePaper.paperType == '2'}">
              <c:if test="${resourcePaper.judementScore !=null}">${resourcePaper.judementScore}</c:if>
            </c:if>
          </h4>
        </div>
      </div>

        <div class="col-md-offset-1" style="padding-left: 30px;">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:set var="indexAns2" value="${resourceQuestion.id}" />
            <div class="row  choicea" >
              <c:if test="${resourceQuestion.questionType == '2' }">
                <c:set var="index" value="${index+1}" />
                ${index}、${resourceQuestion.stem}
                <div class="row ">
                  <br>
                  <c:forEach var="teachStudentPaper" items="${teachStudentPaper}">
                    <c:if test="${teachStudentPaper.questionId == indexAns2 }">
                      <c:set var="answer" value="${teachStudentPaper.answer}" />
                      <c:set var="quesId" value="${teachStudentPaper.id}" />
                      <div class="choice" >
                        <c:set var="value" value="a" />
                        <c:set var="status" value="${teachStudentPaper.answer.equals(value) }" />
                        <input type="radio" name="${quesId}"    <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                        A、${resourceQuestion.option.optionA}
                      </div>
                      <div class="choice" >
                        <c:set var="value" value="b" />
                        <input type="radio" name="${quesId}"    <c:if test="${answer eq value}"> checked="checked"</c:if>  >
                        B、${resourceQuestion.option.optionB}
                      </div>

                  <c:if test="${ifCheckAnswer eq 1 }">
                  <div class="choice">
                    <p style="color: red">正确答案是：
                      <c:forEach var="resourceQuestionAnswer" items="${resourceQuestionAnswer}">
                        <c:if test="${resourceQuestionAnswer.questionId == indexAns2 }">
                              ${resourceQuestionAnswer.answer}
                        </c:if>
                      </c:forEach>
                    </div>
                  </c:if>
                    </c:if>
                  </c:forEach>
                </div>
                <br>
                <br>
              </c:if>
            </div>
          </c:forEach>
        </div>
      <%--</div>--%>

      <div class="row">
        <div class="col-md-2  col-md-offset-1">
          <h4 class="b">四、简答题</h4>
        </div>
        <div class="col-md-2 col-md-offset-1">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:if test="${resourceQuestion.questionType == '3' }">
              <c:set var="index" value="${index+1}" />
            </c:if>
          </c:forEach>
          <h4 class="b">题目数量：${index}</h4>
        </div>
        <div class="col-md-2 col-md-offset-1">
          <h4 class="b">每题分值：
            <c:if test="${resourcePaper.paperType == '1'}">
              <c:if test="${resourceQuestionListShortAnswer!=null&&fn:length(resourceQuestionListShortAnswer)!=0}">${resourceQuestionListShortAnswer[0].questionScore}</c:if>
            </c:if>
            <c:if test="${resourcePaper.paperType == '2'}">
            <c:if test="${resourcePaper.shortAnswerScore !=null}">${resourcePaper.shortAnswerScore}</c:if></h4>
            </c:if>
          </h4>
        </div>
      </div>

        <div class="col-md-offset-1" style="padding-left: 30px;">
          <c:set var="index" value="0" />
          <c:forEach var="resourceQuestion" items="${resourceQuestionList}">
            <c:set var="indexAns3" value="${resourceQuestion.id}" />
            <div class="row  choicea">
              <c:if test="${resourceQuestion.questionType == '3' }">
                <c:set var="index" value="${index+1}" />
                ${index}、${resourceQuestion.stem}
                <div>
                  <c:set var="answer" value="" />
                  <c:forEach var="teachStudentPaper" items="${teachStudentPaper}">
                    <c:if test="${teachStudentPaper.questionId == indexAns3 }">
                      <c:set var="answer" value="${teachStudentPaper.answer}" />
                    </c:if>
                  </c:forEach>
                   <textarea  style="width:500px;height:200px;padding-left: 15px;margin-top: 15px"  name="${indexAns3}" id="${indexAns3}" >${answer} </textarea>
                </div>
                <div>
                    <c:if test="${ifCheckAnswer eq 1 }">
                      </br><p style="color: red">正确答案是：</p>

                      <c:forEach var="resourceQuestionAnswer" items="${resourceQuestionAnswer}">
                        <c:if test="${resourceQuestionAnswer.questionId == indexAns3 }">
                            <textarea style="width:500px;height:200px;padding-left: 15px;margin-top: 15px;color:red" >${resourceQuestionAnswer.answer}</textarea>
                        </c:if>
                      </c:forEach>

                    </c:if>
                  </div>
                <br>
              </c:if>
            </div>
          </c:forEach>
        </div>
      <br>
    </div>

    <div class="form-actions">
      <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
    </div>
  </div>
  </form:form>
</body>
</html>